
package org.hw.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 
 * @TableName member
 * @description  
 */
@Data
@TableName("member")
@ApiModel
public class Member implements Serializable {
    
    /**
     * 微信Id
	 * 
     */
    @ApiModelProperty("微信Id")
    private String wxId;
				
    /**
     * 用户
	 * 
     */
    @ApiModelProperty("用户")
    private String userId;
				
    /**
     * 手机号
	 * 
     */
    @ApiModelProperty("手机号")
    private String phone;
				
    /**
     * 昵称
	 * 
     */
    @ApiModelProperty("昵称")
    private String nickName;
				
    /**
     * 头像
	 * 
     */
    @ApiModelProperty("头像")
    private String avatarUrl;
				
    /**
     * 性别
	 * 
     */
    @ApiModelProperty("性别")
    private String gender;
				
	/**
	 * ID
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@ApiModelProperty("ID")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;
			
	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@ApiModelProperty("创建时间")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long createTime;
				  
	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@ApiModelProperty("创建时间")
	private String createTimeString;
					
	/**
	 * 更新时间
	 */
	@TableField(fill = FieldFill.UPDATE)
	@ApiModelProperty("更新时间")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long updateTime;
					
	/**
	 * 更新时间
	 */
	@TableField(fill = FieldFill.UPDATE)
	@ApiModelProperty("更新时间")
	private String updateTimeString;
					
	/**
	 * 逻辑删除控制
	 */
	@ApiModelProperty("逻辑删除控制")
	@TableLogic
	private Integer state;
			  
	/**
	 * 单位
	 */
	@TableField(fill = FieldFill.INSERT)
	@ApiModelProperty("单位")
	private String unitId;
					
	
	/**
	 * 设置微信Id
	 */
	public void setWxId(String wxId){
		this.wxId = wxId;
	}

	/**
	 * 获取微信Id
	 */
	public String getWxId(){
		return this.wxId;
	}
		
	/**
	 * 设置用户
	 */
	public void setUserId(String userId){
		this.userId = userId;
	}

	/**
	 * 获取用户
	 */
	public String getUserId(){
		return this.userId;
	}
		
	/**
	 * 设置手机号
	 */
	public void setPhone(String phone){
		this.phone = phone;
	}

	/**
	 * 获取手机号
	 */
	public String getPhone(){
		return this.phone;
	}
		
	/**
	 * 设置昵称
	 */
	public void setNickName(String nickName){
		this.nickName = nickName;
	}

	/**
	 * 获取昵称
	 */
	public String getNickName(){
		return this.nickName;
	}
		
	/**
	 * 设置头像
	 */
	public void setAvatarUrl(String avatarUrl){
		this.avatarUrl = avatarUrl;
	}

	/**
	 * 获取头像
	 */
	public String getAvatarUrl(){
		return this.avatarUrl;
	}
		
	/**
	 * 设置性别
	 */
	public void setGender(String gender){
		this.gender = gender;
	}

	/**
	 * 获取性别
	 */
	public String getGender(){
		return this.gender;
	}
		
	/**
	 * 设置ID
	 */
	public void setId(Long id){
		this.id = id;
	}

	/**
	 * 获取ID
	 */
	public Long getId(){
		return this.id;
	}
		
	/**
	 * 设置创建时间
	 */
	public void setCreateTime(Long createTime){
		this.createTime = createTime;
	}

	/**
	 * 获取创建时间
	 */
	public Long getCreateTime(){
		return this.createTime;
	}
		
	/**
	 * 设置创建时间
	 */
	public void setCreateTimeString(String createTimeString){
		this.createTimeString = createTimeString;
	}

	/**
	 * 获取创建时间
	 */
	public String getCreateTimeString(){
		return this.createTimeString;
	}
		
	/**
	 * 设置更新时间
	 */
	public void setUpdateTime(Long updateTime){
		this.updateTime = updateTime;
	}

	/**
	 * 获取更新时间
	 */
	public Long getUpdateTime(){
		return this.updateTime;
	}
		
	/**
	 * 设置更新时间
	 */
	public void setUpdateTimeString(String updateTimeString){
		this.updateTimeString = updateTimeString;
	}

	/**
	 * 获取更新时间
	 */
	public String getUpdateTimeString(){
		return this.updateTimeString;
	}
		
	/**
	 * 设置逻辑删除控制
	 */
	public void setState(Integer state){
		this.state = state;
	}

	/**
	 * 获取逻辑删除控制
	 */
	public Integer getState(){
		return this.state;
	}
		
	/**
	 * 设置单位
	 */
	public void setUnitId(String unitId){
		this.unitId = unitId;
	}

	/**
	 * 获取单位
	 */
	public String getUnitId(){
		return this.unitId;
	}
		
	public String stringify(){
		String rc = "{\"wxId\":\"" + this.getWxId() + "\",\"userId\":\"" + this.getUserId() + "\",\"phone\":\"" + this.getPhone() + "\",\"nickName\":\"" + this.getNickName() + "\",\"avatarUrl\":\"" + this.getAvatarUrl() + "\",\"gender\":\"" + this.getGender() + "\",\"id\":\"" + this.getId() + "\",\"createTime\":\"" + this.getCreateTime() + "\",\"createTimeString\":\"" + this.getCreateTimeString() + "\",\"updateTime\":\"" + this.getUpdateTime() + "\",\"updateTimeString\":\"" + this.getUpdateTimeString() + "\",\"state\":\"" + this.getState() + "\",\"unitId\":\"" + this.getUnitId() + "\"}";
		rc = rc.replaceAll("\"null\"","null").replaceAll("\"([0-9]+)\"","$1");
        return rc;
	}

	public static Member JSONparse(String jsonString) throws JsonProcessingException {
        if(jsonString == null) return null;
		try {
            ObjectMapper objectMapper = new ObjectMapper();
            return objectMapper.readValue(jsonString,Member.class);
        }catch (JsonProcessingException e){
            return null;
        }
    }
}
    